## 
CROSS_COMPILE=aarch64-powereuler-linux-
CC=$(CROSS_COMPILE)gcc
#CXX=$(CROSS_COMPILE)gcc++
CXX=$(CROSS_COMPILE)gcc
## 
CFLAGS  = -Wall -O2 -g -lrt \
		-I../../include/mqtt \
		-I../../include/sqlite \
		-I../../include/unwind \
		-I../../include/zlog \
		-I../../src/common \
		-I../../src/dev_manage \
		-I../../src/log_manage \
		-I../../src/main \
		-I../../src/sqlite_api \
		-L../../lib/Euler/mqtt -L../../lib/Euler/sqlite -L../../lib/Euler/unwind -L../../lib/Euler/zlog -lpaho-mqtt3a -lpaho-mqtt3c -lsqlite3 -lunwind -lzlog -ldl -rdynamic
## 
CXXFLAGS  = -Wall -O2 -g -lrt -L./lib -lpaho-mqtt3as -lHWMQTT -lcjson -lsecurec -lssl -lcrypto -fmessage-length=0 -fPIC -lunwind -ldl -rdynamic

SRCS = $(wildcard ../../src/common/*.c ../../src/dev_manage/*.c ../../src/main/*.c ../../src/sqlite_api/*.c ../../src/log_manage/*.c)  

OBJS = $(patsubst %c, %o, $(SRCS)) 

LIB_PATH = -L./lib 
SRC_PATH = ./src

LIBS += $(LIB_PATH) -lpaho-mqtt3as -lHWMQTT -lcjson -lsecurec -lssl -lcrypto -lunwind -ldl -rdynamic

TARGET = ../../out/Euler/DataCenter

$(TARGET):	$(OBJS)
	$(CXX) -o $@ $^ $(CFLAGS) 
	
%o: %c  
	$(CC) $(CFLAGS) -o $@ $< 

all: $(TARGET)

clean:
	rm -f $(OBJS) $(TARGET)

